home *** CD-ROM | disk | FTP | other *** search
/ IRIS Performer 2.2 Friends Demo / SGI IRIS Performer 2.2 Friends Demo.iso / friends / openworlds / databases / aliens.wrl < prev    next >
Text File  |  1997-11-22  |  16KB  |  562 lines

  1. #VRML V2.0 utf8
  2.  
  3. #OpenWorlds Demo by Daniel Hunt
  4. #email: st93vtzh@dunx1.ocs.drexel.edu
  5.  
  6. Viewpoint {
  7.   description "start"
  8.   position 0 10 60
  9.   orientation 1 0 0 -.3
  10. }
  11.  
  12. Group { children 
  13.   Inline { url "elgrid.wrl" }
  14.   }
  15. DEF SpaceShip Transform { 
  16.   translation 0 5 -40
  17.   children [
  18.     DEF ShipRing Transform {
  19.       scale 1 .15 1
  20.       children 
  21.         Shape { 
  22.           appearance Appearance {
  23.             material Material { diffuseColor .7 .7 1 } 
  24.           }
  25.           geometry Sphere { radius 20 }
  26.         }
  27.     }
  28.     DEF ShipMiddle Transform {
  29.       scale 1 .4 1
  30.       children 
  31.         Shape {
  32.           appearance Appearance {
  33.             material Material { diffuseColor .7 .8 1 }
  34.           }
  35.           geometry Sphere { radius 15 }
  36.         }
  37.     }
  38.     DEF ShipBubble Transform {
  39.       translation 0 5 0
  40.       children 
  41.         Shape {
  42.           appearance Appearance {
  43.             material Material { diffuseColor .7 .95 1 
  44.                                 transparency .4 }
  45.           }
  46.           geometry Sphere { radius 5 }
  47.         }
  48.     }
  49.     Transform {
  50.       translation 13 2 0
  51.       children
  52.       DEF Light1 Switch{
  53.         whichChoice 1
  54.         choice [
  55.           Shape {
  56.         appearance Appearance {
  57.               material Material { diffuseColor 0 0 1 }
  58.             }
  59.             geometry Sphere {}
  60.           }
  61.           Shape {
  62.             appearance Appearance {
  63.               material Material { diffuseColor 0 1 0 }
  64.             }
  65.             geometry Sphere {}
  66.           }
  67.           Shape {
  68.             appearance Appearance {
  69.               material Material { diffuseColor 1 0 0 }
  70.             }
  71.             geometry Sphere {}
  72.           }
  73.         ]
  74.         }
  75.       }
  76.     Transform{
  77.       translation 0 2 13
  78.       children
  79.       DEF Light2 Switch{
  80.         whichChoice  1
  81.         choice [
  82.           Shape {
  83.             appearance Appearance {
  84.               material Material { diffuseColor 0 1 0 }
  85.             }
  86.             geometry Sphere {}
  87.           }
  88.           Shape {
  89.             appearance Appearance {
  90.               material Material { diffuseColor 1 0 0 }
  91.             }
  92.             geometry Sphere {}
  93.           }
  94.           Shape {
  95.             appearance Appearance {
  96.               material Material { diffuseColor 0 0 1 }
  97.             }
  98.             geometry Sphere {}
  99.           }
  100.         ]
  101.         }
  102.       }
  103.     Transform{
  104.       translation -13 2 0
  105.       children
  106.         USE Light1
  107.       }
  108.     Transform{
  109.       translation 0 2 -13
  110.       children 
  111.         USE Light2
  112.       }
  113.   ]
  114. }
  115.  
  116.  
  117. DEF Alien1Move Transform {
  118.   children [
  119.     DEF Alien1Hit TouchSensor { }
  120.     DEF Alien1 Switch {
  121.       choice [
  122.         Shape {
  123.           appearance Appearance {
  124.             material Material{diffuseColor 1 1 1}
  125.             texture ImageTexture { url "alien2.rgba" }
  126.             }
  127.           geometry IndexedFaceSet { 
  128.             coord Coordinate{ 
  129.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  130.               } 
  131.             coordIndex [ 0 1 2 3 -1]
  132.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  133.           }
  134.         }
  135.      Shape {appearance Appearance {
  136.              material Material{diffuseColor 1 1 1}
  137.              texture ImageTexture { url "alien3.rgba" }}
  138.             geometry IndexedFaceSet { coord Coordinate{ point [ -1 -2 0,
  139.              1 -2 0, 1 2 0, -1 2 0 ] } coordIndex [ 0 1 2 3 -1]
  140.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }}
  141.      }
  142.      Shape {appearance Appearance {
  143.              material Material{diffuseColor 1 1 1}
  144.              texture ImageTexture { url "alien4.rgba" }}
  145.             geometry IndexedFaceSet { coord Coordinate{ point [ -1 -2 0,
  146.              1 -2 0, 1 2 0, -1 2 0 ] } coordIndex [ 0 1 2 3 -1]
  147.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }}
  148.      }
  149.      Shape {appearance Appearance {
  150.              material Material{diffuseColor 1 1 1}
  151.              texture ImageTexture { url "alienboom1.rgba" }}
  152.             geometry IndexedFaceSet { coord Coordinate{ point [ -1 -2 0,
  153.              1 -2 0, 1 2 0, -1 2 0 ] } coordIndex [ 0 1 2 3 -1]
  154.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }}
  155.      }
  156.      Shape {
  157.           appearance Appearance {
  158.             material Material{diffuseColor 1 1 1}
  159.             texture ImageTexture { url "alienboom2.rgba" }
  160.             }
  161.           geometry IndexedFaceSet { 
  162.             coord Coordinate{ 
  163.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  164.               } 
  165.             coordIndex [ 0 1 2 3 -1]
  166.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  167.           }
  168.         }
  169.      Shape {
  170.           appearance Appearance {
  171.             material Material{diffuseColor 1 1 1}
  172.             texture ImageTexture { url "alienboom3.rgba" }
  173.             }
  174.           geometry IndexedFaceSet { 
  175.             coord Coordinate{ 
  176.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  177.               } 
  178.             coordIndex [ 0 1 2 3 -1]
  179.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  180.           }
  181.         }
  182.       Shape {
  183.           appearance Appearance {
  184.             material Material{diffuseColor 1 1 1}
  185.             texture ImageTexture { url "alienboom4.rgba" }
  186.             }
  187.           geometry IndexedFaceSet { 
  188.             coord Coordinate{ 
  189.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  190.               } 
  191.             coordIndex [ 0 1 2 3 -1]
  192.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  193.           }
  194.         }
  195.       ]
  196.       whichChoice 1
  197.     }
  198.   ]
  199. }
  200.  
  201. DEF Alien2Move Transform {
  202.   children [
  203.     DEF Alien2Hit TouchSensor { }
  204.     DEF Alien2 Switch {
  205.       choice [
  206.         Shape {
  207.           appearance Appearance {
  208.             material Material{diffuseColor 1 1 1}
  209.             texture ImageTexture { url "alien2.rgba" }
  210.             }
  211.           geometry IndexedFaceSet { 
  212.             coord Coordinate{ 
  213.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  214.               } 
  215.             coordIndex [ 0 1 2 3 -1]
  216.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  217.           }
  218.         }
  219.      Shape {appearance Appearance {
  220.              material Material{diffuseColor 1 1 1}
  221.              texture ImageTexture { url "alien3.rgba" }}
  222.             geometry IndexedFaceSet { coord Coordinate{ point [ -1 -2 0,
  223.              1 -2 0, 1 2 0, -1 2 0 ] } coordIndex [ 0 1 2 3 -1]
  224.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }}
  225.      }
  226.      Shape {appearance Appearance {
  227.              material Material{diffuseColor 1 1 1}
  228.              texture ImageTexture { url "alien4.rgba" }}
  229.             geometry IndexedFaceSet { coord Coordinate{ point [ -1 -2 0,
  230.              1 -2 0, 1 2 0, -1 2 0 ] } coordIndex [ 0 1 2 3 -1]
  231.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }}
  232.      }
  233.      Shape {appearance Appearance {
  234.              material Material{diffuseColor 1 1 1}
  235.              texture ImageTexture { url "alienboom1.rgba" }}
  236.             geometry IndexedFaceSet { coord Coordinate{ point [ -1 -2 0,
  237.              1 -2 0, 1 2 0, -1 2 0 ] } coordIndex [ 0 1 2 3 -1]
  238.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }}
  239.      }
  240.      Shape {
  241.           appearance Appearance {
  242.             material Material{diffuseColor 1 1 1}
  243.             texture ImageTexture { url "alienboom2.rgba" }
  244.             }
  245.           geometry IndexedFaceSet { 
  246.             coord Coordinate{ 
  247.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  248.               } 
  249.             coordIndex [ 0 1 2 3 -1]
  250.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  251.           }
  252.         }
  253.      Shape {
  254.           appearance Appearance {
  255.             material Material{diffuseColor 1 1 1}
  256.             texture ImageTexture { url "alienboom3.rgba" }
  257.             }
  258.           geometry IndexedFaceSet { 
  259.             coord Coordinate{ 
  260.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  261.               } 
  262.             coordIndex [ 0 1 2 3 -1]
  263.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  264.           }
  265.         }
  266.       Shape {
  267.           appearance Appearance {
  268.             material Material{diffuseColor 1 1 1}
  269.             texture ImageTexture { url "alienboom4.rgba" }
  270.             }
  271.           geometry IndexedFaceSet { 
  272.             coord Coordinate{ 
  273.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  274.               } 
  275.             coordIndex [ 0 1 2 3 -1]
  276.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  277.           }
  278.         }
  279.       ]
  280.       whichChoice 1
  281.     }
  282.   ]
  283. }
  284.  
  285.  
  286. DEF Alien3Move Transform {
  287.   children [
  288.     DEF Alien3Hit TouchSensor { }
  289.     DEF Alien3 Switch {
  290.       choice [
  291.         Shape {
  292.           appearance Appearance {
  293.             material Material{diffuseColor 1 1 1}
  294.             texture ImageTexture { url "alien2.rgba" }
  295.             }
  296.           geometry IndexedFaceSet { 
  297.             coord Coordinate{ 
  298.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  299.               } 
  300.             coordIndex [ 0 1 2 3 -1]
  301.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  302.           }
  303.         }
  304.      Shape {appearance Appearance {
  305.              material Material{diffuseColor 1 1 1}
  306.              texture ImageTexture { url "alien3.rgba" }}
  307.             geometry IndexedFaceSet { coord Coordinate{ point [ -1 -2 0,
  308.              1 -2 0, 1 2 0, -1 2 0 ] } coordIndex [ 0 1 2 3 -1]
  309.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }}
  310.      }
  311.      Shape {appearance Appearance {
  312.              material Material{diffuseColor 1 1 1}
  313.              texture ImageTexture { url "alien4.rgba" }}
  314.             geometry IndexedFaceSet { coord Coordinate{ point [ -1 -2 0,
  315.              1 -2 0, 1 2 0, -1 2 0 ] } coordIndex [ 0 1 2 3 -1]
  316.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }}
  317.      }
  318.      Shape {appearance Appearance {
  319.              material Material{diffuseColor 1 1 1}
  320.              texture ImageTexture { url "alienboom1.rgba" }}
  321.             geometry IndexedFaceSet { coord Coordinate{ point [ -1 -2 0,
  322.              1 -2 0, 1 2 0, -1 2 0 ] } coordIndex [ 0 1 2 3 -1]
  323.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }}
  324.      }
  325.      Shape {
  326.           appearance Appearance {
  327.             material Material{diffuseColor 1 1 1}
  328.             texture ImageTexture { url "alienboom2.rgba" }
  329.             }
  330.           geometry IndexedFaceSet { 
  331.             coord Coordinate{ 
  332.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  333.               } 
  334.             coordIndex [ 0 1 2 3 -1]
  335.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  336.           }
  337.         }
  338.      Shape {
  339.           appearance Appearance {
  340.             material Material{diffuseColor 1 1 1}
  341.             texture ImageTexture { url "alienboom3.rgba" }
  342.             }
  343.           geometry IndexedFaceSet { 
  344.             coord Coordinate{ 
  345.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  346.               } 
  347.             coordIndex [ 0 1 2 3 -1]
  348.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  349.           }
  350.         }
  351.       Shape {
  352.           appearance Appearance {
  353.             material Material{diffuseColor 1 1 1}
  354.             texture ImageTexture { url "alienboom4.rgba" }
  355.             }
  356.           geometry IndexedFaceSet { 
  357.             coord Coordinate{ 
  358.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  359.               } 
  360.             coordIndex [ 0 1 2 3 -1]
  361.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  362.           }
  363.         }
  364.       ]
  365.       whichChoice 1
  366.     }
  367.   ]
  368. }
  369.  
  370.  
  371. DEF Alien4Move Transform {
  372.   children [
  373.     DEF Alien4Hit TouchSensor { }
  374.     DEF Alien4 Switch {
  375.       choice [
  376.         Shape {
  377.           appearance Appearance {
  378.             material Material{diffuseColor 1 1 1}
  379.             texture ImageTexture { url "alien2.rgba" }
  380.             }
  381.           geometry IndexedFaceSet { 
  382.             coord Coordinate{ 
  383.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  384.               } 
  385.             coordIndex [ 0 1 2 3 -1]
  386.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  387.           }
  388.         }
  389.      Shape {appearance Appearance {
  390.              material Material{diffuseColor 1 1 1}
  391.              texture ImageTexture { url "alien3.rgba" }}
  392.             geometry IndexedFaceSet { coord Coordinate{ point [ -1 -2 0,
  393.              1 -2 0, 1 2 0, -1 2 0 ] } coordIndex [ 0 1 2 3 -1]
  394.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }}
  395.      }
  396.      Shape {appearance Appearance {
  397.              material Material{diffuseColor 1 1 1}
  398.              texture ImageTexture { url "alien4.rgba" }}
  399.             geometry IndexedFaceSet { coord Coordinate{ point [ -1 -2 0,
  400.              1 -2 0, 1 2 0, -1 2 0 ] } coordIndex [ 0 1 2 3 -1]
  401.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }}
  402.      }
  403.      Shape {appearance Appearance {
  404.              material Material{diffuseColor 1 1 1}
  405.              texture ImageTexture { url "alienboom1.rgba" }}
  406.             geometry IndexedFaceSet { coord Coordinate{ point [ -1 -2 0,
  407.              1 -2 0, 1 2 0, -1 2 0 ] } coordIndex [ 0 1 2 3 -1]
  408.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }}
  409.      }
  410.      Shape {
  411.           appearance Appearance {
  412.             material Material{diffuseColor 1 1 1}
  413.             texture ImageTexture { url "alienboom2.rgba" }
  414.             }
  415.           geometry IndexedFaceSet { 
  416.             coord Coordinate{ 
  417.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  418.               } 
  419.             coordIndex [ 0 1 2 3 -1]
  420.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  421.           }
  422.         }
  423.      Shape {
  424.           appearance Appearance {
  425.             material Material{diffuseColor 1 1 1}
  426.             texture ImageTexture { url "alienboom3.rgba" }
  427.             }
  428.           geometry IndexedFaceSet { 
  429.             coord Coordinate{ 
  430.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  431.               } 
  432.             coordIndex [ 0 1 2 3 -1]
  433.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  434.           }
  435.         }
  436.       Shape {
  437.           appearance Appearance {
  438.             material Material{diffuseColor 1 1 1}
  439.             texture ImageTexture { url "alienboom4.rgba" }
  440.             }
  441.           geometry IndexedFaceSet { 
  442.             coord Coordinate{ 
  443.               point [ -1 -2 0, 1 -2 0, 1 2 0, -1 2 0 ]
  444.               } 
  445.             coordIndex [ 0 1 2 3 -1]
  446.             texCoord TextureCoordinate {point [0 0, 1 0, 1 1, 0 1] }
  447.           }
  448.         }
  449.       ]
  450.       whichChoice 1
  451.     }
  452.   ]
  453. }
  454.  
  455.  
  456.  
  457.  
  458. DEF clock TimeSensor {
  459.   loop TRUE
  460.   cycleInterval  60 
  461.   startTime .2
  462.   }
  463.  
  464. DEF spinner OrientationInterpolator{
  465.   key [ 0, .25, .5, .75, 1]
  466.   keyValue [0 1 0 0, 0 1 0 3.1415, 0 1 0 6.28, 0 1 0 9.42, 0 1 0 12.56]
  467. }
  468.  
  469. DEF blinker Cycle{
  470.   max 2 
  471.   speed 10
  472. }
  473.  
  474. DEF control1 AlienControl {
  475.   start 0 2 -42
  476. }
  477.  
  478. DEF control2 AlienControl {
  479.   start 1 2 -40 
  480. }
  481.  
  482. DEF control3 AlienControl {
  483.   start -1 2 -38 
  484. }
  485.  
  486. DEF control4 AlienControl {
  487.   start -2 2 -44 
  488. }
  489.  
  490. Sound {
  491.   source 
  492.     DEF peace1 AudioClip {
  493.       url "peace.aiff"
  494.       }
  495.   }
  496.  
  497. Sound {
  498.   source 
  499.     DEF splat1 AudioClip{
  500.       url "splat.aiff"
  501.       }
  502.   }
  503.  
  504. Sound {
  505.   source 
  506.     DEF splat2 AudioClip {
  507.       url "splat.aiff"
  508.       }
  509.   }
  510.  
  511.  
  512. Sound {
  513.   source
  514.     DEF splat3 AudioClip {
  515.       url "splat.aiff"
  516.       }
  517.   }
  518.  
  519.  
  520. Sound {
  521.   source 
  522.     DEF splat4 AudioClip {
  523.       url "splat.aiff"
  524.       }
  525.   }
  526.  
  527.  
  528.  
  529. ROUTE control1.startTime TO peace1.startTime
  530. ROUTE Alien1Hit.touchTime TO splat1.startTime
  531.  
  532. ROUTE Alien2Hit.touchTime TO splat2.startTime
  533.  
  534. ROUTE Alien3Hit.touchTime TO splat3.startTime
  535.  
  536. ROUTE Alien4Hit.touchTime TO splat4.startTime
  537.  
  538.  
  539.  
  540.  
  541. ROUTE Alien1Hit.isActive TO control1.shot
  542. ROUTE control1.position TO Alien1Move.set_translation
  543. ROUTE control1.which TO Alien1.whichChoice
  544.  
  545. ROUTE Alien2Hit.isActive TO control2.shot
  546. ROUTE control2.position TO Alien2Move.set_translation
  547. ROUTE control2.which TO Alien2.whichChoice
  548.  
  549. ROUTE Alien3Hit.isActive TO control3.shot
  550. ROUTE control3.position TO Alien3Move.set_translation
  551. ROUTE control3.which TO Alien3.whichChoice
  552.  
  553. ROUTE Alien4Hit.isActive TO control4.shot
  554. ROUTE control4.position TO Alien4Move.set_translation
  555. ROUTE control4.which TO Alien4.whichChoice
  556.  
  557. ROUTE blinker.which TO Light1.whichChoice
  558. ROUTE blinker.which TO Light2.whichChoice
  559. ROUTE clock.fraction_changed TO spinner.set_fraction
  560. ROUTE spinner.value_changed TO SpaceShip.set_rotation
  561.  
  562.